package com.woldier.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.woldier.entity.DishFlavor;
import com.woldier.mapper.DishFlavorMapper;

import com.woldier.service.DishFlavorService;

import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class DishFlavorServiceImpl extends ServiceImpl<DishFlavorMapper, DishFlavor> implements DishFlavorService {
    /**
     * 根据dish_id返回
     * */
    @Override
    public List<DishFlavor> getByDishId(Long id) {
        /*更具dish_id查询dish_flavor表查询口味*/

        LambdaQueryWrapper<DishFlavor> lambdaQueryWrapper1 = new LambdaQueryWrapper<>();
        lambdaQueryWrapper1.eq(DishFlavor::getDishId,id);
        /*查询数据库*/
        List<DishFlavor> list1 = this.list(lambdaQueryWrapper1);
        return list1;
    }
}
